package com.hmall.client;


import com.hmall.common.Address;
import com.hmall.interceptor.MyFeignInterceptor;
import com.hmall.search.common.dto.Item;
import com.hmall.search.common.dto.PageDTO;
import org.bouncycastle.voms.VOMSAttribute;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;


@FeignClient(value = "itemservice",configuration = MyFeignInterceptor.class)
public interface MyFeignClient {

    @GetMapping("/item/list")
    PageDTO<Item> insert(@RequestParam("page") Long page, @RequestParam("size") Long size);

    @GetMapping("/item/{id}")
    Item findById(@PathVariable("id") Long id);

    @PutMapping("/item/stock/{itemId}/{num}")
    void updateItemStock(@PathVariable("itemId")Long itemId,@PathVariable("num")Integer num);

}
